<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;

class IndexController extends Controller
{
    public function index(Request $request)
    {

        // 后台的首页：获取用户的角色信息
        $roles = Auth::guard('backLogin')->user()->roles; // Auth::guard('backLogin')->user() 当前登录用户的模型对象
        $roleName = $roles->implode('show_name', '、');

        return view('admin.index.index', compact('roleName'));
    }

    public function welcome()
    {
        return view('admin.index.welcome');
    }
}
